﻿using Sirius.Application;
using static Sirius.Log.Log;
using static Sirius.SystemDll.kernel32;


namespace Sirius.Help
{
    public static class Help
    {
        //内置菜单
        public static void help()
        {
            LogOut("帮助", "1.查看已加载应用信息");
            LogOut("帮助", "2.加载指定应用窗口");
            LogOut("帮助", "3.卸载指定应用");
            LogOut("帮助", "4.加载指定应用");

        }

        //应用列表
        public static int showApplicationList()
        {
            if (ApplicationManager.apps.Count == 0)
            {
                LogWar("已加载插件", "当前暂无插件");
                return 0;
            }
            for (int i = 0; i < ApplicationManager.apps.Count; i++)
            {
                Console.WriteLine("应用ID:" + i + ":" + ApplicationManager.apps[i].appInfo.App_Name);
            }
            LogOut("help", "以上为所有已加载插件");
            return ApplicationManager.apps.Count;


        }
        public static void showApplicationMenu(string appIndex)
        {
            try
            {
                ApplicationManager.apps[int.Parse(appIndex)].Method._menuA();
            }
            catch (Exception e)
            {
                LogErr("窗口载入", "插件不存在，或输入错误" + e);
            }
        }


    }
}